package com.zf.tmall.user.test;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;

import cn.hutool.core.lang.Console;
import cn.hutool.http.HttpUtil;

public class RequestCase {

	public static final String base_url = "http://localhost:8002/user";

	public static void main(String[] args) {

		wechatlogin();
	}

	public static void register() {

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("userMobile", "21222222251");
		map.put("password", "111111");
		String ret = HttpUtil.post(base_url + "/register", JSONObject.toJSONString(map), 3000);
		Console.log("请求返回值为: {} ", ret);
	}

	public static void login() {

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("userMobile", "21222222251");
		map.put("password", "111111");
		String ret = HttpUtil.post(base_url + "/login", JSONObject.toJSONString(map), 3000);
		Console.log("请求返回值为: {} ", ret);

	}

	public static void wechatlogin() {

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("userMobile", "13598001019");
		//map.put("password", "111111");
		String ret = HttpUtil.post(base_url + "/wechatlogin", JSONObject.toJSONString(map), 3000);
		Console.log("请求返回值为: {} ", ret);

	}

}
